Log In  
BBS > Lexaloffle Community Superblog
This is a combined feed of all Lexaloffle user blogs. For Lexaloffle-related news, see @zep's blog.

All | Following | PICO-8 | Voxatron | General | Off-site
[ :: Read More :: ]

Okay this is going to be a hard bug to resolve, because it's tough to pin down. I'm on Win 10 64bit, and for the past few versions of Pico-8, games have been having this input dropping issue every so often. It's definitely in v0.2.4 (original, no b c d), and may be in v0.2.3 or earlier, but the recent stat(28) raw input addition makes me think it started happening around that time.

What happens: you're playing a game normally, then you lose all control for a few seconds. The game is still updating and drawing, but mashing keyboard keys does nothing. I could record the next time it happens, but it's random AND rare, and all you'd see is the game running with the player standing still. After a few seconds, input starts working again.

Why this sucks to debug: not only do you have to be paying active attention to the game, you also don't know when it's going to happen. Sometimes you just think you messed up and pressed the wrong buttons, since it's hard to be sure, and everything is normal after a few seconds. But this is a critical btn/btnp bug that's severely reducing the quality of gameplay, so it needs to be fixed. The best I can do to help is say that I'm playing in windowed mode on the left half of the screen, there are no alerts or Windows messages that might be grabbing focus (as far as I know), and the issues occur long into a gameplay session (sometimes a half-hour or more between drops?).

Could be related to integer overflow, though this feels more random than that. The Lua code of a few games I checked are just btn/btnp'ing every frame, so it's not user error. Could also be the window losing focus, but I run this computer lean and don't have any kind of discord/antivirus/other popups ever show up in the notification bar, and pico-8 was focused in the taskbar. I'll try adding read_controllers_in_background=1 to see if that fixes things, but it may take a while for me to encounter the bug again, and it was happening before v0.2.4c was ever posted. I'm honestly not sure what else it could be, no other program on my computer has this input dropping issue.

P#111477 2022-05-07 20:36 ( Edited 2022-05-07 20:37)
[ :: Read More :: ]

I ran into an issue last night and today where a cart isn't saving. I only noticed today when I reopened pico-8 and some changes were missing. Here's the series of events:

  1. Did some work last night
  2. At some point I took a screenshot (F6) and/or made a .gif (F9). I'm a beginner so both of these were the first time I ran these commands ever.
  3. Made a few more changes
  4. Saved without realizing it wasn't saving (maybe I just didn't see the error message)
  5. Closed pico-8 and went to sleep
  6. Woke up today and noticed code was missing the edits (small clunky feature implementation so wasn't worried)
  7. Write some new code - still not realizing it wasn't saving when I pressed CMD+s
  8. Finally noticed it wasn't saving

So at this point I am on a Discord server (Lazy Devs) and asked if anyone had some tips. I got a lot of helpful feedback and tried a bunch of commands. Nothing persisted and the consensus is that it's likely a bug and probably related to permissions (the carts dir has R/W shown for my user account). Some things I tried:

folder - correctly opens the carts dir
save gives the error "failed to save"
save abc - no error, but no cart in the folder
export abc.pb - same as above
export .png - same as above

I haven't tried restart or anything like for now in case there's some debugging I could do to help fix any possible bugs. There's other things I can work on for now so let me know how I can help. Thanks!

MacBook Pro (15-inch, 2018)
Monterery 12.2.1 (21D62)

Model Name: MacBook Pro
Model Identifier: MacBookPro15,1
Processor Name: 6-Core Intel Core i9
Processor Speed: 2.9 GHz
Number of Processors: 1
Total Number of Cores: 6
L2 Cache (per Core): 256 KB
L3 Cache: 12 MB
Hyper-Threading Technology: Enabled
Memory: 32 GB

P#111468 2022-05-07 17:29
[ :: Read More :: ]

Is there a way to get pico8 language support AND support for included files within VS Code?

I'm using the pico8-ls extension, which is great, but it doesn't recognise #include files, so I miss out on code completion on functions imported by my .p8 file. If I switch and use the lua language server extension: https://marketplace.visualstudio.com/items?itemName=sumneko.lua I get code recognition of my functions, but not the p8 functions (weirdly the lua language server seems to assume files are included even if they are not, or at least it seems to me it does). I'd ideally like both p8 function recognition from the pico8-ls AND recognition of my included functions. But this doesn't seem possible as of today.

I did note that support for #include files is a planned featured of the pico8-ls function so maybe I just have to wait for that

P#111467 2022-05-07 16:43
[ :: Read More :: ]

Cart #flow_smithothy-0 | 2022-05-07 | Code ▽ | Embed ▽ | No License
4

Mouse and keyboard required.

P#111435 2022-05-07 07:30 ( Edited 2022-05-10 21:16)
[ :: Read More :: ]

Cart #stocks_falling-1 | 2022-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

STOCKS FALLING!

It's the old Nintendo "Game & Watch" game "Fire", except it's your tech stocks and crypto portfolios falling during the 2022 stock crash! And the next day, they crash even more!

Can you survive long enough for your stocks to fall into the gates of hell?

P#111429 2022-05-07 02:06 ( Edited 2022-05-07 02:15)
[ :: Read More :: ]

Old builds of my completed game

Cart #rushtree11232-0 | 2022-05-14 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

Cart #pitareriso-0 | 2022-05-09 | Code ▽ | Embed ▽ | No License
3

Cart #ramsajru-0 | 2022-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

P#111419 2022-05-06 21:30 ( Edited 2023-02-05 00:25)
[ :: Read More :: ]

When using Ctrl-X to cut and paste sprites, the sprite flags remain in the old sprite location. Maybe this is intentional? But it seems like maybe the sprite flags should reset back to a brand new, untouched sprite state when sprites are cut and then pasted elsewhere. Here's a GIF showing the behavior:

P#111411 2022-05-06 20:49
[ :: Read More :: ]

Cart #yamizezide-0 | 2022-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

my first and probably last celeste mod
Explore a small world of jank, rem, and questionable level design

P#111389 2022-05-06 13:22 ( Edited 2022-05-09 15:38)
[ :: Read More :: ]

Edit: Beta is now closed and the final game is now here

Cart #community_game_2022_beta-0 | 2022-05-29 | Code ▽ | Embed ▽ | No License
3

I've been kicking around the Pico-8 community for about a year now creating games under NerdOfGamers/RyanCavendell (depending on where you might frequent). I'm currently trying to set up the infrastructure to automate a community game jam using Lexaloffle's Edu version. So I'm looking for sign-ups for the Beta to make sure all the automated systems are working in real life as I'm anticipating potential problems (already done testing myself and seems stable but that will only go so far).

If you want to make a small game together with the community and help beta test this then the sign-up form is here > https://forms.gle/dzwgUiGXGebsnhTd7 < with text from sign-up form below

Concept:

Everyone taking part has a turn in generating a game together using Lexaloffle's web-based Pico-8 Education version (https://www.pico-8-edu.com/). At the end of the project the final game will be published to Itch.io for free, under the unlicense and creative commons attribution v4.0 international licenses, in HTML5 format and all URLs generated during the project will be publicly and freely shared. There is a limit of 2040 characters across all code, graphics, and audio so use them wisely!

Rules:

  • A random person is drawn to start the project, with each developer taking random turns
  • The latest URL will be sent to the current developer who then has 24 hours to complete 1 hour of development before sending an update via their emailed response copy
  • When a new URL is submitted by the current developer it immediately sends the latest URL to the next developer
  • If for some reason an update is not received within 24 hours the developer will be marked as being finished and latest URL will be passed to the next developer
  • Once the last developer has finished the project will automatically stop
  • I'm currently unable to re-add skipped developers, so for now submit a fresh from and you'll re-entered and eligible to have a turn again

Submission:

  • Once your 1 hour of dev time is up, use "save @url" command (this will update the URL)
  • Open up your response email, click on "edit response" button at the top of the page
  • Copy and paste the URL into the Pico-8 Edu URL and click "Submit"
P#111376 2022-05-06 09:18 ( Edited 2022-05-29 13:11)
[ :: Read More :: ]

Cart #modular_kobolds-0 | 2022-05-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

Hey!

I make a lot of little games and I'm not good at pixel art, so I've been reusing the same character art again and again from project to project. I thought some other people might have the same problem, so I dumped the character art and most of my animation code into this cartridge. I also wrote a little platformer engine just so you can see how these animations might look in an actual project.

Folks who like cute little lizard dudes will likely be pleased, but I added swappable heads.

The public interface of moko consists of all its fields and methods, not all of which are documented.

Chances are you won't need all the animations in whatever project you use this in -- but they should be pretty easy to delete.

Later I'll probably file this down and tidy it up, but I never let lack of polish keep me from open-sourcing things if I can help it!

This cart is mirrored on GitHub here: https://github.com/nyeogmi/modular-kobolds/tree/main

P#111374 2022-05-06 05:17 ( Edited 2022-05-06 05:18)
[ :: Read More :: ]

internal voxatron carts to import for education learning, since dont seem available at designer
rights reserved to owners
https://www.lexaloffle.com/bbs/?uid=1
https://www.lexaloffle.com/bbs/?uid=9308

Cart #mhedupipi-0 | 2022-05-05 | Embed ▽ | No License


Cart #wibojiwipu-0 | 2022-05-05 | Embed ▽ | No License


Cart #tosegozeri-0 | 2022-05-05 | Embed ▽ | No License


Cart #bahitatofi-0 | 2022-05-05 | Embed ▽ | No License


Cart #matumnaba-0 | 2022-05-05 | Embed ▽ | No License


Cart #radirediyi-0 | 2022-05-05 | Embed ▽ | No License


Cart #peheyezosi-0 | 2022-05-05 | Embed ▽ | No License


Cart #tayakiragi-0 | 2022-05-05 | Embed ▽ | No License


Cart #pamazeniri-0 | 2022-05-05 | Embed ▽ | No License


Cart #pawonezega-0 | 2022-05-05 | Embed ▽ | No License


Cart #famabegehe-0 | 2022-05-05 | Embed ▽ | No License


Cart #burubaduko-0 | 2022-05-05 | Embed ▽ | No License


Cart #gufuzobuki-0 | 2022-05-05 | Embed ▽ | No License


Cart #rujorinidu-0 | 2022-05-05 | Embed ▽ | No License


Cart #gutuhagihu-0 | 2022-05-05 | Embed ▽ | No License


Cart #jiwezitopa-0 | 2022-05-05 | Embed ▽ | No License


Cart #kajaseheda-0 | 2022-05-05 | Embed ▽ | No License


Cart #fusumojino-0 | 2022-05-05 | Embed ▽ | No License


Cart #sebosemami-0 | 2022-05-05 | Embed ▽ | No License


Cart #bamurusamo-0 | 2022-05-05 | Embed ▽ | No License


Cart #nakuheware-0 | 2022-05-05 | Embed ▽ | No License

P#111358 2022-05-05 21:50 ( Edited 2022-05-12 09:25)
[ :: Read More :: ]

Cart #muhigagepu-0 | 2022-05-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

This shit a game

P#111339 2022-05-05 15:47
[ :: Read More :: ]

Cart #sinazubiwa-0 | 2022-05-05 | Code ▽ | Embed ▽ | No License
1

P#111329 2022-05-05 13:37
[ :: Read More :: ]

Cart #sujekakoni-0 | 2022-05-05 | Code ▽ | Embed ▽ | No License

P#111327 2022-05-05 13:34
[ :: Read More :: ]

Cart #hirahibapa-0 | 2022-05-05 | Code ▽ | Embed ▽ | No License

P#111307 2022-05-05 02:35 ( Edited 2022-05-05 13:33)
[ :: Read More :: ]

Cart #nofehukjo-0 | 2022-05-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Newbie amateur game dev here! I've been programming for a few years now, mostly for academic/scientific purposes. I've always wanted to try my hand at making games, but I've always found an excuse not to.

So screw that, I'm starting from zero in a new language doing the absolute minimum that I can call a "thing" and here it is: a very simple histogram tool that "rolls" virtual dice and displays the frequency of the different rolls (excluding events with zero-frequency).

I'm used to doing this with more sophisticated tools and ad-hoc libraries, learning to do things «by hand» is a challenge in and of itself.

The histograms do not generally follow the distribution that one would expect. I believe this happens because:

  1. Strong cryptographic principles and robust (pseudo-)random number generation is outside the scope of a tool like Pico-8, and
  2. Andy has screwed something in the code and prefers to publish something imperfect rather than trying to perfect it and never publish it.

So here it is, a small tool that will expose me and might help someone in the future.

Customization

Ideally, you should only need to customize three things:

  • rolls is how many times you will try the experiment; in a real-life situation you want this to be large
  • dpr is how many dice you're rolling each time. It's the first number in the common dice notation (1d8)
  • ds is the dice size, or how many faces the virtual dice have. Common dice for D&D are obviously 4, 6, 8, 10, 12, and 20; but one can customize it to other numbers for «impossible» dice.

What else?

I haven't tested this with larger numbers, mostly because P8 is not the tool for such rigorous analysis and data visualization. Use large numbers at your peril.

P#111298 2022-05-04 21:28
[ :: Read More :: ]

Okay, when viewing code for a bunch of games, there seems to be variables that are put into the parentheses after a function's name. What are the purpose of these?
My guess is that they're local variables, but I have no idea.

P#111299 2022-05-04 21:06
[ :: Read More :: ]

Cart #dailycalpuz-0 | 2022-05-04 | Code ▽ | Embed ▽ | No License
6

Here's Dailycalpuz!

Each day a new puzzle. Fit all pieces into the calendar to leave the current date showing.

P#111297 2022-05-04 20:31
[ :: Read More :: ]

I may have a non-standard definition of fun...

Disclaimer: I'm fully aware that this is quite likely a completely useless little utility as far as PICO-8 development is concerned. I just like writing this kind of thing just for fun. But if you do find it interesting or useful, let me know!

This is basically just a function which allows you to create curried functions—which I attempt to explain below if you're unfamiliar with them—which can be partially applied in a natural way in Lua. I'm not sure why it took me so long to write this since it's just a rip-off of my python implementation of the same thing.

Anyway, here it is on github or you can copy/paste the code from the example.

Example

Here's a simple little proto-game thing which I stuffed full of as many curried functions as I thought I could reasonably get away with. Not gonna claim that it's the best—or even good—way to organize a game but I think it does an okay job of showing how to use partial application as a sort of dependency injection/data encapsulation.

Cart #curry_demo-1 | 2022-05-03 | Code ▽ | Embed ▽ | No License
2

What is function currying?

If you've never encountered curried functions before they can seem a bit weird at first but they're actually pretty simple.

Function currying — which gets its name from mathematician Haskell Curry for whom the Haskell programming language is also named — is a transformation which turns a function which accepts multiple arguments into a series of functions which each accept only a single argument. For instance, if we have this function which accepts three arguments:

    function sum3(x, y, z)
       return x + y + z
    end

Then when we curry it, we end up with a function which takes the first argument and returns a new function. This new function accepts the second argument and returns a third function which accepts the third argument and finally returns the result. We could write that manually like so:

    function sum3_curried(x)
       return function(y)
          return function(z)
              return x + y + z
          end
       end
    end

The curry function basically does this for you so instead of having to write a bunch of nested functions manually you could just do this:

    sum3_curried = curry(3, sum3)

Or this without having to define sum3 first:

    sum3_curried = curry(
       3, function(x, y, z)
          return x + y + z
       end
    )

Which makes it easier to see what the function is doing without having to wade through multiple levels of nested functions.

And I would want to do that because…?

Curried functions can be useful in a bunch of situations but they all basically come down to one thing: partial application.

With the sum3 function you have to pass all the arguments at once or else you'll get an error. With sum3_curried you can pass one, two, or all three and you'll always get something back. In the case of one or two arguments, you'll get back a function which you can stash in a variable and use later. In other words, you can pass curried functions some of their arguments now and the rest of their arguments at some later time.

But isn't sum3_curried(1)(2) kind of ugly and annoying to write?

It sure is!

The curry function doesn't actually construct a bunch of nested functions. Instead, the function returned by curry takes a variable number of arguments and keeps track of how many it's got so far. Once it has the right number of arguments, it calls the actual function and returns the result.

These are all valid ways of calling the versions of sum3_curried created with curry:

    sum3_curried(1, 2, 3)
    sum3_curried(1)(2, 3)
    sum3_curried(1, 2)(3)
    sum3_curried(1)(2)(3)
P#111095 2022-05-03 21:16
[ :: Read More :: ]

I am getting different results when invoking code in the console as opposed to calling it from inside a running program. The code overrides the default behaviour of the cos function.

pi=3.14159
two_pi=pi*2

-- override cos to work with radians
p8cos = cos
function cos(rad) return p8cos(rad/two_pi) end

-- degrees to radians
function d2r(d) return d*two_pi/360 end

-- this test works (cos(45 deg) => 0.7071)
function _draw()
 cls()
 print(cos(d2r(45)))
end

I then run the code, observing correct results (0.7071).

Invoking this from the console however: print(cos(d2r(45))) prints different results (0.2206).

Are function overrides ignored in the console?

P#111239 2022-05-03 13:35
View Older Posts